﻿namespace AstoriaPlus
{
	using System.Data.Services;

	public interface IEntityChangeRules<TDataService, TDataSource> : IFluentInterface
		where TDataService : DataService<TDataSource>
		where TDataSource : class
	{
		ExtendedDataServiceConfiguration<TDataService, TDataSource> Configuration { get; }

		IEntityChangeRules<TDataService, TDataSource> InterceptWith(IEntityInterceptorFactory<TDataService, TDataSource> interceptorFactory);

		IEntityChangeRules<TDataService, TDataSource> InterceptWith<TEntityInterceptor>()
			where TEntityInterceptor : IEntityInterceptor<TDataService, TDataSource>, new();
	}

	public interface IEntityChangeRules<TDataService, TDataSource, TEntity> : IFluentInterface
		where TDataService : DataService<TDataSource>
		where TDataSource : class
		where TEntity : class
	{
		ExtendedDataServiceConfiguration<TDataService, TDataSource> Configuration { get; }

		IEntityChangeRules<TDataService, TDataSource, TEntity> InterceptWith(IEntityInterceptorFactory<TDataService, TDataSource, TEntity> interceptorFactory);

		IEntityChangeRules<TDataService, TDataSource, TEntity> InterceptWith<TEntityInterceptor>()
			where TEntityInterceptor : IEntityInterceptor<TDataService, TDataSource, TEntity>, new();
	}
}
